<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :payments } %>

<% content_for :page_title do %>
  / <%= Spree.t(:new_payment) %>
<% end %>

<% if @payment_methods.any? %>
  <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @payment } %>

  <%= form_for @payment, url: admin_order_payments_path(@order) do |f| %>
    <fieldset>
      <%= render partial: 'form', locals: { f: f } %>

      <div class="form-actions" data-hook="buttons">
        <%= button @order.cart? ? Spree.t('actions.continue') : Spree.t('actions.update'), @order.cart? ? 'arrow-right.svg' : 'save.svg' %>
      </div>
    </fieldset>
  <% end %>

<% else %>
  <div class="alert alert-info">
    <%= Spree.t(:cannot_create_payment_without_payment_methods) %>
    <%= link_to Spree.t(:please_define_payment_methods), spree.admin_payment_methods_url %>
  </div>
<% end %>
